package cn.ac.iscas.domain.response.middleplatform.datasource;

import cn.ac.iscas.base.utils.AesEncryptHandler;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author lirenshen
 * @version 1.0
 * @date 2022/3/2 10:14
 * @since jdk11
 */

//@ApiModel(value = "DmoDatasource对象", description = "数据源")
//@TableName("dmo_rest_datasource")
@Component
public class DmoDatasource {

    //@ApiModelProperty(value = "id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    //@ApiModelProperty(value = "数据源名称")
    private String datasourceName;

    //@ApiModelProperty(value = "数据源类型")
    private String datasourceType;

    //@ApiModelProperty(value = "数据库名称")
    private String databaseName;

    //@ApiModelProperty(value = "描述信息")
    private String description;

    //@ApiModelProperty(value = "用户名")
    @TableField(typeHandler = AesEncryptHandler.class)
    private String username;

    //@ApiModelProperty(value = "密码")
    @TableField(typeHandler = AesEncryptHandler.class)
    private String password;

    //@ApiModelProperty(value = "host")
    private String host;

    //@ApiModelProperty(value = "端口")
    private Integer port;

    //@ApiModelProperty(value = "状态")
//    @TableLogic
    private Integer status;

    //@ApiModelProperty(value = "集群地址,如 http://172.16.10.155:9200,http://172.16.10.158:9200")
    private String endpoint;

    //@ApiModelProperty(value = "连接类型，如 es 的有 http、https等")
    private String connectType;

    //@ApiModelProperty(value = "数据源类别，如database、filesystem、excel等")
    private String category;

    //@ApiModelProperty(value = "关联的数据源ID,类型必须为filesystem类型的，为excel类型存储所用")
    private Integer excelReFileDatasourceId;

    //@ApiModelProperty(value = "excel的存储路径")
    private String excelPath;

    //@ApiModelProperty(value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    //@ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    //@ApiModelProperty(value = "更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    //@ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDatasourceName() {
        return datasourceName;
    }

    public void setDatasourceName(String datasourceName) {
        this.datasourceName = datasourceName;
    }

    public String getDatasourceType() {
        return datasourceType;
    }

    public void setDatasourceType(String datasourceType) {
        this.datasourceType = datasourceType;
    }

    public String getDatabaseName() {
        return databaseName;
    }

    public void setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public String getConnectType() {
        return connectType;
    }

    public void setConnectType(String connectType) {
        this.connectType = connectType;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public Integer getExcelReFileDatasourceId() {
        return excelReFileDatasourceId;
    }

    public void setExcelReFileDatasourceId(Integer excelReFileDatasourceId) {
        this.excelReFileDatasourceId = excelReFileDatasourceId;
    }

    public String getExcelPath() {
        return excelPath;
    }

    public void setExcelPath(String excelPath) {
        this.excelPath = excelPath;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
